import req from '@/utils/request'
const baseURL = process.env.VUE_APP_BASE_URL
// const baseKey = ''
// export function getAreatypes2(params) {
//     return req({
//         method: 'get',
//         url: baseURL2 + '/superlink/api/areatypes',
//         params
//     })
// }
export function getAreatypes(params) {
    return req({
        method: 'get',
        url: baseURL + '/superlink/api/areatypes',
        params
    })
}
export function putAreatypes(data, token) {
    return req({
        method: 'put',
        url: baseURL + '/superlink/api/areas/update/' + token,
        data
    })
}
export function putDeviceAssignment(data, idList) {
    return req({
        method: 'put',
        url: baseURL + "/superlink/api/production/formula/deviceAssignment?" + idList,
        data
    })
}
export function getAreas(params, areaToken) {
    return req({
        method: 'get',
        url: baseURL + (areaToken ? '/superlink/api/areas/' + areaToken : '/superlink/api/areas'),
        params
    })
}
export function getDistributionAreas(params) {
    return req({
        method: 'get',
        url: baseURL + '/superlink/api/areas',
        params
    })
}

export function addAreas(data) {
    return req({
        method: 'post',
        url: baseURL + '/superlink/api/areas/create',
        data
    })
}
export function addAreasSon(data) {
    return req({
        method: 'post',
        url: baseURL + '/superlink/api/areas',
        data
    })
}
export function addAreasType(data) {
    return req({
        method: 'post',
        url: baseURL + '/superlink/api/areatypes/create',
        data
    })
}
export function addAreasToken(params, areaToken) {
    return req({
        method: 'get',
        url: baseURL + '/superlink/api/areatypes/' + areaToken,
        params
    })
}
export function putAreasToken(data, areaToken) {
    return req({
        method: 'put',
        url: baseURL + '/superlink/api/areatypes/update/' + areaToken,
        data
    })
}
export function delAreasToken(areaToken) {
    return req({
        method: 'delete',
        url: baseURL + '/superlink/api/areatypes/delete/' + areaToken,
    })
}
export function getQrcode(data, areaToken) {
    return req({
        method: 'get',
        url: baseURL + "/superlink/api/areatypes/" + areaToken + "/label/qrcode",
        ...data
    })
}
export function getQrcodeAreas(data, areaToken) {
    return req({
        method: 'get',
        url: baseURL + "/superlink/api/areas/" + areaToken + "/label/qrcode",
        ...data
    })
}
export function delAreas(areaToken) {
    return req({
        method: 'delete',
        url: baseURL + "/superlink/api/areas/delete/" + areaToken,
    })
}
